﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
using ifunction.SqlDeployConsole.Core;
using System.Threading;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.IO;
using ifunction.SqlDeployConsole.Properties;

namespace ifunction.SqlDeployConsole
{
    class Program
    {
        static readonly string configPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Constants.ConfigurationFilePath);

        /// <summary>
        /// Application entry.
        /// </summary>
        /// <param name="args">The args.      
        /// arg[0]: connection string
        /// arg[1]: type(Full or Incremental)
        /// OR
        /// arg[0]: type(Full or Incremental)
        /// </param>
        static void Main(string[] args)
        {
            if (Settings.Default.IsDebug)
            {
                Console.WriteLine("It is in debug mode. Please attach process and press any key to continue.");
                Console.Read();
            }

            if (args == null)
            {
                args = new string[] { };
            }

            SqlExecutor executor = new SqlExecutor();
            executor.Execute(args);

            Console.WriteLine("Press any key to exit.");
            Console.Read();
        }
    }
}
